<template>
	<view>
		<view class="lists acea-row row-between-wrapper" v-for="val in list" @click="urlSet(val.post_url)">
			<view class="zhangtai  acea-row row-center-wrapper" v-if='val.status == 1' :class="val.status == 0?'backcolor1':'backcolor2'" >
				<span></span>
				<view>{{val.icon}}</view>
			</view>
			<view class="zhangtai  acea-row row-center-wrapper" v-if='val.status == 0' :class="val.status == 0?'backcolor1':'backcolor2'" >
				<span></span>
				<view>{{val.icon}}</view>
			</view>
			<image :src="val.thumbnail" mode="aspectFill"></image>
			<view class="rits">
				<view class="title textline">{{val.post_title}}</view>
				<view class="acea-row Jud">
					<view class="jiangjie">主讲：{{val.post_ren}}</view>
					<view class="zhuanyei">{{val.post_yy}}</view>
				</view>
				<view class="acea-row row-between-wrapper botts">
					<view class="acea-row timesc">
						<image src="../../static/z.png"></image>
						<view class="time">{{val.post_times}}</view>
					</view>
					<view :class="val.status == 0?'yuyues' :val.status==1 ?'biaoqian':'biaoqian' ">
						{{val.button}}
					</view>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
			list:[]
			}
		},
		onLoad() {
			var that = this
			var user_id = uni.getStorageSync('ids')
			this.$api('/portal/index/myyy',{datas:{user_id:user_id}},function(res){
				console.log(res)
				that.list = res.data.data
			})
			var jweixin = require('jweixin-module')
			var that = this
			console.log(jweixin)
				var urls = window.location.href
			this.$api('/portal/index/jsconfig', {datas:{url:urls}}, function(res) {
				console.log(res)
				var s = res.data.data
				jweixin.config({
				    debug: false,
				    appId: s.appId,
				    timestamp: s.timestamp,
				    nonceStr: s.nonceStr,
				    signature:s.signature,
				    jsApiList: ["updateTimelineShareData","updateAppMessageShareData"]
				});
				jweixin.ready(function(){
			jweixin.updateTimelineShareData({
					title: '海绵医学院', // 分享标题
				    link: urls, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
				    imgUrl: 'http://api.haimiantv.cn/upload/default/20200426/86ea4921376b6656f24fbb40e674b361.png', // 分享图标
				    success: function () {
				      // 设置成功
					  console.log(1)

				    }
			})
			jweixin.updateAppMessageShareData({
				title: '海绵医学院', // 分享标题
				desc: '一个专业/有态度的医学直播交流平台', // 分享描述
				link: urls, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
				imgUrl: 'http://api.haimiantv.cn/upload/default/20200426/86ea4921376b6656f24fbb40e674b361.png', // 分享图标
				success: function () {
				  // 设置成功
				}
			  })



				})
				jweixin.error(function(res){
					console.log(res)
				})
			})
		},
		methods: {
			urlSet(e){
				console.log(e)
				window.location.href = e
				// uni.navigateTo({
				// 	url:'../webView/webView?url='+e
				// })

			}
		}
	}
</script>

<style>
	.biaoqian {
		color: #53B655;
		font-size: 22rpx !important;
		padding: 5rpx 10rpx;
		background-color: #F2F3F3;
		border-radius: 25rpx;
	}
	.yuyues {
		background: linear-gradient(90deg, rgba(22, 137, 244, 1), rgba(38, 200, 202, 1));
		border-radius: 22rpx;
		width: 140rpx;
		height: 52rpx;
		color: #fff;
		font-size: 26rpx;
		position: absolute;
		right: 30rpx;
		bottom: 30rpx;
		text-align: center;
		line-height: 52rpx;
	}

	.wenzhi {
		padding: 33rpx;

	}

	.zhusyzx {
		align-items: center;
		margin: 15rpx 0;
	}

	.zhibos {
		align-items: center;
	}

	.title {
		font-size: 32rpx;
		font-weight: bold;
		color: #000000;
	}

	.zhuj {
		font-size: 24rpx;
		color: #999999;
		margin-right: 15rpx;
	}

	.zhuan {
		font-size: 20rpx !important;
		color: #FFA708;
		padding: 3rpx 10rpx;
		border: 1px solid #FFA708;
		border-radius: 30rpx;
	}

	.zhibos image {
		width: 23rpx;
		height: 23rpx;
		margin-right: 20rpx;
	}

	.zhibos {
		font-size: 20rpx !important;
		color: #40A3FC;
	}

	.lists {
		width: 684rpx;
		box-shadow: 0px 4px 21px 0px rgba(0, 0, 0, 0.06);
		margin: 0 auto;
		margin-top: 20rpx;
		position: relative;
		background-color: #fff;
	}

	.lists>image {
		width: 100%;
		height: 248rpx;
		border-radius: 20rpx 20rpx 0 0;
	}
	.zhangtai {
		background-color: rgba(0, 0, 0, .6);
		width: 152rpx;
		height: 54rpx;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 9;
		color: #fff;
		font-size: 26rpx;
		border-radius: 20rpx 0 50rpx 0;
	}
	.zhangtai span {
		border-radius: 50%;
		margin-right: 15rpx;
		display: block;
		width: 10rpx;
		height: 10rpx;
	}

	.backcolor1 span {
		background-color: #FFBD40;
	}

	.backcolor2 span {
		background-color: #5DE23F;
	}
	.timesc {
		color: #40A3FC;
		align-items: center;
		font-size: 20rpx;
		margin-top: 10rpx !important;
	}

	.timesc image {
		width: 23rpx;
		height: 23rpx;
		margin: 0;
		margin-right: 15rpx;
	}
	.lists .rits{
		width: 100%;
		padding: 25rpx;
	}
	.rits .title{
		font-size: 28rpx;
		color: #000000;
		font-weight: bold;
	}
	.lists .jiangjie{
		color: #666666;
		font-size: 24rpx;
		margin-right: 10rpx;
	}
	.lists .zhuanyei{
		font-size: 20rpx !important;
		border: 1px solid #FFA708;
		color: #FFA708;
		padding: 3rpx 10rpx;
		border-radius: 30rpx;

	}
	.Jud{
		margin-top: 15rpx;
	}
</style>
